<template>
    <div>
        <van-nav-bar fixed=true   placeholder=true title="消息" />
        <van-card v-for="(detailItem, index) in tableData" :key="index" :title="detailItem.name"
            :thumb="detailItem.image" @click="toDetails(detailItem.fromid, detailItem.toid, detailItem.name)">
        </van-card>
        <div style="height:200px"></div>
    </div>
</template>
<script>
export default {
    name: '聊天汇总',
    data() {
        return {
            tableData: [],
        };
    },
    created() {
        this.init()
    },
    components: {
    },
    methods: {
        init() {
            this.axios({
                method: "GET",
                url: "/aapi/liaotiantotal"
            }).then(response => {
                this.tableData = response.data
            })
        },
        toDetails(fromid, toid, name) {
            this.$store.commit("fromid", fromid)
            this.$store.commit("toid", toid)
            this.$store.commit("toname", name)
            this.$router.push('/d')
        },
    }
}
</script>